/*
 * Copyright (C) 2009 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.common.collect;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Map;

/**
 * @author Hayward Chan
 */
final class Serialization {

  private Serialization() {}

  private static UnsupportedOperationException unsupported() {
    return new UnsupportedOperationException(
        "com.google.common.collect.Serialization is not supported in GWT.");
  }

  static int readCount(ObjectInputStream stream) {
    throw unsupported();
  }

  static <K, V> void writeMap(Map<K, V> map, ObjectOutputStream stream)
      throws IOException {
    throw unsupported();
  }

  static <K, V> void populateMap(Map<K, V> map, ObjectInputStream stream)
      throws IOException, ClassNotFoundException {
    throw unsupported();
  }

  static <K, V> void populateMap(
      Map<K, V> map, ObjectInputStream stream, int size)
      throws IOException, ClassNotFoundException {
    throw unsupported();
  }

  static <E> void writeMultiset(
      Multiset<E> multiset, ObjectOutputStream stream) {
    throw unsupported();
  }

  static <E> void populateMultiset(
      Multiset<E> multiset, ObjectInputStream stream) {
    throw unsupported();
  }

  static <E> void populateMultiset(
      Multiset<E> multiset, ObjectInputStream stream, int distinctElements) {
    throw unsupported();
  }

  static <K, V> void writeMultimap(
      Multimap<K, V> multimap, ObjectOutputStream stream) {
    throw unsupported();
  }

  static <K, V> void populateMultimap(
      Multimap<K, V> multimap, ObjectInputStream stream) {
   throw unsupported();
  }

  static <K, V> void populateMultimap(
      Multimap<K, V> multimap, ObjectInputStream stream, int distinctKeys) {
   throw unsupported();
  }

  static <T> FieldSetter<T> getFieldSetter(
      final Class<T> clazz, String fieldName) {
    throw unsupported();
  }

  static final class FieldSetter<T> {

    void set(T instance, Object value) {
      throw unsupported();
    }

    void set(T instance, int value) {
      throw unsupported();
    }
  }
}
